package com.galeno.topn;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * Author:   galeno
 * Date:     21/07/28
 * Description:
 */
public class MyPartitioner extends Partitioner<MovieBean, NullWritable> {
    @Override
    public int getPartition(MovieBean movieBean, NullWritable nullWritable, int i) {
        return (((movieBean.getMovie()+"").hashCode()) & Integer.MAX_VALUE ) % i;
    }
}
